﻿using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

namespace Sidvall.Security
{
    public interface IAuthenticationClient
    {
        string CreateAuthorizeAddress(string clientId, string responseType, string scope, string redirectAddress, string state, string nonce, string logOnHint,
            string authenticationContextReferences, string prompt, string responseMode, string codeChallenge, string codeChallengeMethod, Dictionary<string, string> additionalValues);
        string CreateLogOffAddress(string identityToken, string redirectAddress);

        Task<TokenResponse> RequestAssertionAsync(string assertionType, string assertion, string scope, Dictionary<string, string> additionalValues, CancellationToken cancellationToken);
        Task<TokenResponse> RequestAuthorizationCodeAsync(string code, string redirectAddress, string codeVerifier, Dictionary<string, string> additionalValues, CancellationToken cancellationToken);
        Task<TokenResponse> RequestClientCredentialsAsync(string scope, Dictionary<string, string> additionalValues, CancellationToken cancellationToken);
        Task<TokenResponse> RequestCustomAsync(Dictionary<string, string> values, CancellationToken cancellationToken);
        Task<TokenResponse> RequestCustomGrantAsync(string grantType, string scope, Dictionary<string, string> additionalValues, CancellationToken cancellationToken);
        Task<TokenResponse> RequestRefreshTokenAsync(string refreshToken, Dictionary<string, string> additionalValues, CancellationToken cancellationToken);
        Task<TokenResponse> RequestResourceOwnerPasswordAsync(string userName, string password, string scope, Dictionary<string, string> additionalValues, CancellationToken cancellationToken);
    }
}
